<template>
  <div>
    <a-modal width="40%" v-model="visible" title="查询">
      <table class="form">
<#list proList as pro>
        <tr>
          <td class="label w100">${pro.column.comment}</td>
          <#if pro.infoShow&&pro.formType??>
          <#if pro.formType=="img"> 
          <td><ImgHolder style="width:200px;" :src="obj.${pro.name}"></ImgHolder></td>
          <#elseif pro.formType=="dic">
          <td><DicHolder :code="obj.${pro.name}"/></td>
          <#elseif pro.formType=="tags">
          <td><TagViewer v-if="obj.${pro.name}" :array="JSON.parse(obj.${pro.name})"></TagViewer></td>
          <#elseif pro.formType=="tinymce"> 
          <td><div v-html="genHtml(obj.${pro.name})"></div></td>
          <#elseif pro.formType=="switch">
          <td>{{ obj.${pro.name}?'是':'否' }}</td>
          <#elseif pro.formType=="date"> 
          <td>{{ obj.${pro.name} }}</td>
          <#elseif pro.formType=="datetime"> 
          <td>{{ obj.${pro.name} }}</td>
          <#elseif pro.formType=="time"> 
          <td>{{ obj.${pro.name} }}</td>
          <#elseif pro.formType=="select"||pro.formType=="radio">
          <td>{{ getOptLabel(dic.${pro.name}Opts, obj.${pro.name}) }}</td>
          <#elseif pro.formType=="checkbox">
          <td><TagViewer :array="getOptLabels(dic.${pro.name}Opts, obj.${pro.name})"></TagViewer></td>
          <#elseif pro.formType=="banner"> 
          <td><Banner v-if="obj.${pro.name}" :imgs="JSON.parse(obj.${pro.name})"/></td>
          <#elseif pro.formType=="imgs"> 
          <td><Banner :mode="1" v-if="obj.${pro.name}" :imgs="JSON.parse(obj.${pro.name})"/></td>
          <#else>
          <td>{{ obj.${pro.name} }}</td>
          </#if>
          </#if>
        </tr>
</#list>
      </table>
    </a-modal>
  </div>
</template>

<script>
import { dic } from './dic'
export default {
  data () {
    return {
      dic,
      visible: false,
      obj: {}
    }
  },
  mounted () {
  },
  methods: {
    init (obj) {
      this.obj = JSON.parse(obj)
    },
    show () {
      this.visible = true
    },
    hide () {
      this.visible = false
    }
  }
}
</script>
<style lang="less" scoped>
</style>
